﻿using System.Configuration;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Chowpoo.Util;

namespace CourseSystem.Common.Helpers
{
    public class CommonHelper
    {
        public static readonly int PageSize = 10;
        public static readonly string StudentDefPassWord = "123456";
        /// <summary>
        /// 结尾包含'/'
        /// </summary>
        public static readonly string Domain;
        static CommonHelper()
        {
            PageSize = ConfigurationManager.AppSettings["PageSize"].CheckInt(10);
            //Domain = ConfigurationManager.AppSettings["Domain"].TrimEnd('/') + '/';
            Domain = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority +
                      HttpContext.Current.Request.ApplicationPath;
            Domain = Domain.TrimEnd('/')+'/';
            StudentDefPassWord = ConfigurationManager.AppSettings["StudentDefPassWord"] ?? StudentDefPassWord;
        }
    }
}